//
//  OrderModel.m
//  WHB_driver
//
//  Created by 徐国庆 on 15/12/29.
//  Copyright (c) 2015年 turing. All rights reserved.
//

#import "OrderModel.h"

@implementation OrderModel

+(NSDictionary*)JSONKeyPathsByPropertyKey{
    
    return @{
             @"orderId":@"orderId",
             @"orderNo":@"orderNo",
             @"startAddressName":@"startAddressName",
             @"endAddressName":@"endAddressName",
             @"mediumName":@"mediumName",
             @"weight":@"weight",
             @"getOrgName":@"getOrgName",
             @"getOrgAuthStatus":@"getOrgAuthStatus",
             @"getGoodsTelNum":@"getGoodsTelNum",
             @"loadGoodsTime":@"loadGoodsTime",
             @"getGoodsAddress":@"getGoodsAddress",
             @"note":@"note",
             @"orderStatus":@"orderStatus",
             @"takeGoodsQRCode":@"takeGoodsQRCode",
             
             @"finishStatus":@"finishStatus",
             
             @"expectFreight":@"expectFreight",
             @"receiptOrgName":@"receiptOrgName",
             @"receiptOrgAuthStatus":@"receiptOrgAuthStatus",
             @"receiptGoodsTelNum":@"receiptGoodsTelNum",
             @"carrierOrgName":@"carrierOrgName",
             @"carrierOrgAuthStatus":@"carrierOrgAuthStatus",
             @"carrierOrgTelNum":@"carrierOrgTelNum",
             @"orderTime":@"orderTime",
             @"grabTime":@"grabTime",
             @"takeTime":@"takeTime",
             @"deliveryTime":@"deliveryTime",
             @"signTime":@"signTime",
             @"driverEvaluationStar":@"driverEvaluationStar",
             @"driverEvaluationTimes":@"driverEvaluationTimes",
             @"ownerEvaluationStar":@"ownerEvaluationStar",
             @"ownerEvaluationTimes":@"ownerEvaluationTimes",
             @"orgEvaluationStar":@"orgEvaluationStar",
             @"orgEvaluationTimes":@"orgEvaluationTimes",
             @"pushLicensePlate":@"pushLicensePlate",
            };
}


#pragma mark -
#pragma mark 对字段值进行转换 方法名称格式为:属性+JSONTransformer 否则框架无法识别转换方法
//amount
+(NSValueTransformer*)amountJSONTransformer{
    
    return [MTLValueTransformer reversibleTransformerWithBlock:^id(NSString *amout) {
        return @(amout.floatValue);
    }];
}

//realPrice
+(NSValueTransformer*)realPriceJSONTransformer{
    
    return [MTLValueTransformer reversibleTransformerWithBlock:^id(NSString *realPrice) {
        return @(realPrice.floatValue);
    }];
}



@end
